package com.clss.webrtclibrary;

import org.webrtc.VideoFrame;
import org.webrtc.VideoSink;

/**
 * @author liuv
 */
public class ProxyVideoSink implements VideoSink {
    private VideoSink target;

    @Override
    synchronized public void onFrame(VideoFrame frame) {
        if (target == null) {
            return;
        }
        target.onFrame(frame);
    }

    synchronized public void setTarget(VideoSink target) {
        this.target = target;
    }

    synchronized public VideoSink getTarget(){
        return target;
    }
}
